﻿using System.Windows;
using System.Windows.Controls;
using BVClient.Managers;

namespace BVClient.UserControls
{
    /// <summary>
    /// Interaction logic for ProductDataGrid.xaml
    /// </summary>
    public partial class ProductDataGrid : UserControl
    {
        public ProductDataGrid()
        {
            InitializeComponent();
        }

        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            ProductProvider productProvider = ((System.Windows.Data.ObjectDataProvider)(this.FindResource("ProductProvider"))).ObjectInstance 
                                                    as ProductProvider;
            if (productProvider != null)
            {
                productProvider.SaveData();
            }
        }
    }
}
